package com.example.jdbc.adapter;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;

/**
 * @program: sms
 * @description:
 * @author: zhanghz001
 * @create: 2020-11-09 15:51
 **/
public class MyConnection3 extends MyAdapter {
    private final Connection connection;
    private final List<Connection> pool;

    public MyConnection3(Connection connection, List<Connection> pool) {
        super(connection);
        this.connection = connection;
        this.pool = pool;
    }

    @Override
    public void close() throws SQLException {
        pool.add(connection);
    }
}
